﻿/*using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FeedDotNet.Common;
using System.Net;
using System.IO;

namespace ConsoleApplication
{
    class MovieDBProxy
    {
        const string MovieDBFullUrl = "http://api.movieposterdb.com/image/{0}/{1}/poster.jpg";

        public static void FetchNewTitles(List<YahooNZBData> items)
        {
            DropBoxInterop dropBoxUploader = new DropBoxInterop();
            foreach (YahooNZBData item in items)
            {
                byte[] imageBuffer = null;

                WebRequest webRequest = HttpWebRequest.Create(string.Format(MovieDBFullUrl, item.imdbID, 300));
                webRequest.Method = "GET";
                try
                {
                    using (WebResponse response = webRequest.GetResponse())
                    {
                        Stream responseStream = response.GetResponseStream();
                        using (MemoryStream ms = new MemoryStream())
                        {
                            byte[] buffer = new byte[1024];
                            while (true)
                            {
                                int length = responseStream.Read(buffer, 0, buffer.Length);

                                if (length <= 0)
                                    break;

                                ms.Write(buffer, 0, length);
                            }

                            ms.Position = 0;
                            imageBuffer = ms.ToArray();
                        }

                        dropBoxUploader.UploadFile(string.Format("{0}_{1}.jpg", item.imdbID, 300), imageBuffer);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("failed to read in image data");
                    throw e;
                }
                

            }
        }
    }
}
*/